//
//  userViewController.m
//  UI20_豆瓣电影storyBoard
//
//  Created by 王阳阳 on 16/1/4.
//  Copyright © 2016年 www.lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "userViewController.h"
#import "shoucangViewController.h"
#import "usermovieViewController.h"
@interface userViewController ()<UITableViewDataSource, UITableViewDelegate>
@property (nonatomic, retain)NSMutableArray *arr;
@end

@implementation userViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
        [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"bg.png"] forBarMetrics:UIBarMetricsDefault];
     self.arr = [@[@"我的活动",@"我的电影",@"清除缓存"]mutableCopy];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 20;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];


    if (indexPath.row <= 2) {
        cell.textLabel.text = _arr[indexPath.row];
    }else
    {
        cell.textLabel.text = @"   ";
    }
    
    return cell;

}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
   
    if (indexPath.row == 0) {
        shoucangViewController *activco = [[shoucangViewController alloc]init];
        [self.navigationController pushViewController:activco animated:YES];
    }
    if (indexPath.row == 2) {
        NSFileManager *fManager = [NSFileManager defaultManager];
        [fManager removeItemAtPath:@"Catch" error:nil];
            }
    if (indexPath.row == 1) {
        usermovieViewController *userm = [[usermovieViewController alloc]init];
        [self.navigationController pushViewController:userm animated:YES];
    }

}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
